Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump logs for the deepgram issue detection #910

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

beastoin
Copy link
Collaborator

@beastoin beastoin commented Sep 23, 2024

Summary by Entelligence.AI

  • Chore: Added debugging enhancements to the stream_audio and receive_audio functions in transcribe.py. This will improve our ability to troubleshoot issues and ensure a smoother user experience with audio streaming and receiving.

@beastoin beastoin merged commit 4faf7cc into main Sep 23, 2024
1 check passed
@beastoin beastoin deleted the frxxwiaf_deepgram_obns3 branch September 23, 2024 02:21
Copy link

github-actions bot commented Sep 23, 2024

Image description Entelligence.AI

Walkthrough

The changes introduced in this commit primarily focus on enhancing the debugging process for the stream_audio and receive_audio functions in the transcribe router. This is achieved by adding print statements to these functions, which will provide more visibility into their execution.

Changes

File Summary
backend/routers/transcribe.py Debugging capabilities have been improved with the addition of print statements in the stream_audio and receive_audio functions.

🎉🤖

With each line of code, we grow,

Debugging prints, a knowledge flow.

In the stream of audio's tide,

Now no bug can run or hide. 🐞💻


Uplevel your code reviews with Entelligence.AI Pro

Entelligence.AI Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, Entelligence.AI Pro is free for open source projects.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between e9ef2cf and 5ccdf90 commits.
Files selected (1)
  • backend/routers/transcribe.py (3)
Review comments generated (3)
  • Review: 3
  • LGTM: 0

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

@@ -205,6 +205,7 @@ def stream_audio(audio_buffer):
file_path, duration = None, 0
if language == 'en' and (codec == 'opus' or codec == 'pcm16') and include_speech_profile:
file_path = get_profile_audio_if_exists(uid)
print(f'deepgram-obns3: file_path {file_path}')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

While it's understandable that you're adding print statements for debugging purposes, it's not a good practice to leave them in the production code. Instead, consider using a logging library which can be configured to output logs at different levels (DEBUG, INFO, WARNING, ERROR, CRITICAL). This way, you can set the level of logging at runtime without having to modify your code.

- print(f'deepgram-obns3: file_path {file_path}')
+ import logging
+ logging.debug(f'deepgram-obns3: file_path {file_path}')

@@ -219,6 +220,7 @@ def stream_audio(audio_buffer):
stream_transcript, speech_profile_stream_id, language, sample_rate, deepgram_codec_value, channels
)

print(f'deepgram-obns3: send_initial_file_path > deepgram_socket {deepgram_socket}')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Same as above, replace the print statement with a debug log statement.

- print(f'deepgram-obns3: send_initial_file_path > deepgram_socket {deepgram_socket}')
+ logging.debug(f'deepgram-obns3: send_initial_file_path > deepgram_socket {deepgram_socket}')

Comment on lines +297 to +298
print(f'deepgram-obns3: receive_audio > dg_socket1 {dg_socket1}')
print(f'deepgram-obns3: receive_audio > dg_socket2 {dg_socket2}')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Again, replace the print statements with debug log statements.

- print(f'deepgram-obns3: receive_audio > dg_socket1 {dg_socket1}')
- print(f'deepgram-obns3: receive_audio > dg_socket2 {dg_socket2}')
+ logging.debug(f'deepgram-obns3: receive_audio > dg_socket1 {dg_socket1}')
+ logging.debug(f'deepgram-obns3: receive_audio > dg_socket2 {dg_socket2}')

Remember to configure the logging level appropriately in your application's configuration or main function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant